package com.government.common.utils.file;

/**
 * 媒体类型工具类
 *
 * @author system
 */
public class MimeTypeUtils
{
    public static final String IMAGE_PNG = "image/png";

    public static final String IMAGE_JPG = "image/jpg";

    public static final String IMAGE_JPEG = "image/jpeg";

    public static final String IMAGE_BMP = "image/bmp";

    public static final String IMAGE_GIF = "image/gif";

    public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };

    public static final String[] FLASH_EXTENSION = { "swf", "flv" };

    public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
            "asf", "rm", "rmvb" };

    public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" };

    public static final String[] DEFAULT_ALLOWED_EXTENSION = {
           "ceb","doc","zip","mhtml","txt","doc","docx","dotx","xls","xlsx","ppt","pptx","wps","pdf","html","htm","rar","jsp","gif","jpg","jpeg","mpeg","png","mp3","mp4","xltx","potx","ppsx","tiff","swf","flv","rmvb","mvb","ofd","et","lnk","com","cmd","exe","rtf","wma","asp","bmp","jpeg","psd","cdr","ai","wav","cda","flac","midi","avi","mov","rm","asf","wmv","mkv","dwg","dxf","dwt"};

    public static String getExtension(String prefix)
    {
        switch (prefix)
        {
            case IMAGE_PNG:
                return "png";
            case IMAGE_JPG:
                return "jpg";
            case IMAGE_JPEG:
                return "jpeg";
            case IMAGE_BMP:
                return "bmp";
            case IMAGE_GIF:
                return "gif";
            default:
                return "";
        }
    }
}
